package com.ky.tms.controller;

import com.ky.tms.service.ITmsUserService;
import com.ky.tms.util.CommonResult;
import com.ky.tms.vo.TmsLogin;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/tms/login")
public class LoginController {

    @Autowired
    private ITmsUserService tmsUserService;

    @PostMapping
    @ApiOperation("系统登陆")
    public CommonResult login (@RequestBody TmsLogin tmsLogin) throws Exception {
        Map<String, Object> login = tmsUserService.login(tmsLogin);
        return CommonResult.buildSuccess(login);
    }
}
